﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace AMSReportBuildService
{
    class DataAccess
    {
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="sqlString"></param>
        /// <returns></returns>
        public static DataSet GetData(string sqlString)
        {
            SqlConnection con = new SqlConnection(Configure.GetConnectionString());
            try
            {
                DataSet table = new DataSet();
               
                con.Open();
                SqlDataAdapter adapter = new SqlDataAdapter(sqlString, con);
                adapter.Fill(table);
                return table;
            }
            finally
            {
                con.Close();
            }
        }
    }
}
